package ex.com

import org.apache.commons.lang.StringUtils;

class Product {

	static constraints = {
//		name(nullable:true, validator:{val, obj ->
//			if(!val){
//				return true
//			}
//			if(!StringUtils.isAsciiPrintable(val)){
//				return "default.ascii.message"
//			}
//		})
		name(nullable:false)
	}
	static hasMany = [productVendors: ProductVendor]

	static namedQueries = {
		priceGt { p ->
			gt("price", p)
		}
	}
	String name;
	Double price

	String vendor
	String lease
	String maker
}
